package com.ruoyi.jl.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.jl.domain.GameConfig;
import com.ruoyi.jl.mapper.GameConfigMapper;
import com.ruoyi.jl.service.IGameConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 玩家游玩日志 服务层实现
 * 
 * @author ruoyi
 * @date 2019-05-29
 */
@Slf4j
@Service
public class GameConfigServiceImpl extends ServiceImpl<GameConfigMapper, GameConfig> implements IGameConfigService {

    @Override
    public List<GameConfig> list(GameConfig gameConfig){
        LambdaQueryWrapper<GameConfig> wrapper = new LambdaQueryWrapper<>();
        if(gameConfig != null){
            if(StringUtils.isNotEmpty(gameConfig.getId())){
                wrapper.eq(GameConfig::getId, gameConfig.getId());
            }
            if(StringUtils.isNotEmpty(gameConfig.getPlayerId())){
                wrapper.eq(GameConfig::getPlayerId, gameConfig.getPlayerId());
            }
            if(StringUtils.isNotEmpty(gameConfig.getSlotType())){
                wrapper.eq(GameConfig::getSlotType, gameConfig.getSlotType());
            }
        }
        return baseMapper.selectList(wrapper);
    }
}
